
Imports System.Configuration
Imports System.Web.Configuration
Imports System.IO

Partial Public Class _Default
    Inherits System.Web.UI.Page

    Private Shared config As nFlickrViewerConfigurationSection = ConfigurationManager.GetSection("nFlickrViewer")

    Dim galleryTitle As String
    Dim contactMeEmailAddress As String
    Dim cacheConfig As CacheConfig
    Public xmlPath As String

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        If config IsNot Nothing Then
            galleryTitle = config.SimpleViewerConfigurationElement.galleryTitle
            contactMeEmailAddress = config.SimpleViewerConfigurationElement.contactMeEmailAddress
            PageTitle.Text = galleryTitle
            If Not String.IsNullOrEmpty(contactMeEmailAddress) Then
                hlContact.NavigateUrl = "mailto:" & contactMeEmailAddress
                hlContact.Visible = True
            Else
                hlContact.Visible = False
            End If

            CacheConfig = CacheConfig.GetInstance()
            'cacheConfig.DoCreateCacheProp
            'cacheConfig.DoUseCacheProp
        End If

        If CacheConfig.DoUseCacheProp = True And CacheConfig.DoCreateCacheProp = False Then
            xmlPath = "FlickrData.xml"
        Else
            xmlPath = "FlickrData.aspx"
        End If

    End Sub

End Class